package io.litchi.common.page;

import lombok.Data;

import java.util.Collections;
import java.util.List;

/**
 * description: PageResult
 *
 * @author helang
 * @date 2025-09-02 15:46
 */
@Data
public class PageResult<R> {

    private List<R> list;

    private Long total;

    private PageResult(List<R> list, Long total) {
        this.list = list;
        this.total = total;
    }

    public static <R> PageResult<R> empty() {
        return new PageResult<R>(Collections.emptyList(), 0L);
    }

    public static <R> PageResult<R> of(List<R> list, Long total) {
        return new PageResult<R>(list, total);
    }
}